#include "utils/Thread.h"
#include "utils/Mutex.h"
#include "log/Log.h"
#include <iostream>

using namespace utils;
using namespace log;

unsigned num = 0;
Mutex g_mutex;

void func()
{
    while (true)
    {
        LockGuard<Mutex> lock(g_mutex);
        SYS_ERROR() << num++; 
    }
}

int main(int argc, char const *argv[])
{

    log::LoggerManager::instance()->init("./config/log.json");
    Thread t(&func);
    Thread t2(&func);

    t.join();
    t2.join();
    
    return 0;
}
